package com.taotao.content.controller;

import com.taotao.common.dto.TbContent;
import com.taotao.common.pojo.TaotaoResult;
import com.taotao.content.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 内容管理Controller
 * <p>Title: ContentController</p>
 * <p>Description: </p>
 * <p>Company: www.itcast.cn</p> 
 * @version 1.0
 */
@RestController
public class ContentController {

	@Autowired
	private ContentService contentService;

	@PostMapping("/content/save")
	public TaotaoResult addContent(@RequestBody TbContent content) {
		TaotaoResult result = contentService.addContent(content);
		return result;
	}
	@GetMapping("/getContentByCid/{cid}")
	public List<TbContent> getContentByCid(@PathVariable("cid") long cid){
		return contentService.getContentByCid(cid);
	}
}
